package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 证件有效期: 0：非长期有效 ,1：长期有效
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum CertValidityTypeEnum {

    NO(0, "非长期有效"),
    YES(1, "长期有效"),
//    JUNGZ("02", "对私非法人账户"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    CertValidityTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static CertValidityTypeEnum typeOfValue(Integer value) {
        CertValidityTypeEnum[] values = CertValidityTypeEnum.values();
        for (CertValidityTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static CertValidityTypeEnum typeOfName(String name) {
        CertValidityTypeEnum[] values = CertValidityTypeEnum.values();
        for (CertValidityTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
